UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+kwvih3Tt//dS+8Azz/khHAQVBa/Q4N2Ehpk6cR9p8g=' 
WHERE 
  key_id = '796e8cf7af05fa018ba164237feaf28c1ff4c60f19c67c80b0b3769f5ddf32f3' 
  AND (
    token = '+kwvih3Tt//dS+8Azz/khHAQVBa/Q4N2Ehpk6cR9p8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033