UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Eot5iuMQLll2cC4l0He6N/h2dSzeKXzJJAW4ijQEDU=' 
WHERE 
  key_id = '433fdc2df5af0f3f41cbed059a731846bfb3a1c03c12bd41e7a077318ff33561' 
  AND (
    token = '0Eot5iuMQLll2cC4l0He6N/h2dSzeKXzJJAW4ijQEDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057