UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7VDBBxL2rOVdHGhorxeq7bt0SWSpPN2wZNIvYQKhhRA=' 
WHERE 
  key_id = 'e4df665865728c9ae88eb45c4907568aec114a0c7be3daa691a46b1ed33114c6' 
  AND (
    token = '7VDBBxL2rOVdHGhorxeq7bt0SWSpPN2wZNIvYQKhhRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020