UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J9Uo7o4QBkmdbZVmEMM5tQZO4VXrHR+0vEyYtVcRKm4=' 
WHERE 
  key_id = '19e84d3dc34ee27428398f5293d6b997cc3d7df62f160567c1bf3265e014507f' 
  AND (
    token = 'J9Uo7o4QBkmdbZVmEMM5tQZO4VXrHR+0vEyYtVcRKm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036