UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KMsj30A/ykEr0L3LzxGoYhXjoyoSGqP2i4pUN83413c=' 
WHERE 
  key_id = 'e53562401e4b4ab7a573470b5bc0f4d86ac1c094a714956a54912bfd841cc5e7' 
  AND (
    token = 'KMsj30A/ykEr0L3LzxGoYhXjoyoSGqP2i4pUN83413c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049