UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IzMe02CW27jU4c/l95dk2Ckjnh9pSABS9+a+Z3KXGSY=' 
WHERE 
  key_id = 'f97b4c4f3c4021df22d349cb3cda4d2efa8bd1af4b2f7593917b38bcfb79f33e' 
  AND (
    token = 'IzMe02CW27jU4c/l95dk2Ckjnh9pSABS9+a+Z3KXGSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038