UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pwd1T5d5bMQSHvBWTPvOmxx1Br7XCYdw1na5oxmpsfM=' 
WHERE 
  key_id = '978fe98246f6ddad279e4216b19ce726a4a7af614ddb13c24da212f6ab7d0d9a' 
  AND (
    token = 'Pwd1T5d5bMQSHvBWTPvOmxx1Br7XCYdw1na5oxmpsfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039