UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rRNQSklKQ6kIUbBr+1PEI1Z3zlh8whn7/3ANEVWlbY=' 
WHERE 
  key_id = '238ea14142bdb157a31d3f65f43d7a3c2a891185d7b81397f25809ddabf79091' 
  AND (
    token = '1rRNQSklKQ6kIUbBr+1PEI1Z3zlh8whn7/3ANEVWlbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054