UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9xI+gG+hvScH+emN/XQ4wl84f3Qcj1UApyJP3+EcEmk=' 
WHERE 
  key_id = '05da814458e48bb722ae93ae8a44abb848ffdf4d58b08d1bab8b3146e6c9c033' 
  AND (
    token = '9xI+gG+hvScH+emN/XQ4wl84f3Qcj1UApyJP3+EcEmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026