UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CnvpHp0IxNzfSf2Xk0Hnd9UHjo/EgvOK9th7RTVKJo8=' 
WHERE 
  key_id = '992628b0e07477143590efcb09a63b62c63e5eae97f87f993ddb5fe8bcfb1ea1' 
  AND (
    token = 'CnvpHp0IxNzfSf2Xk0Hnd9UHjo/EgvOK9th7RTVKJo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029