UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FzGOFbgjO4bwONysfjI6DdSo1+QVCk3/F5zuZUq8ds=' 
WHERE 
  key_id = '83a4371c17f7220cb33703d1456433c558328387fd423f54c1a5be522d373205' 
  AND (
    token = '4FzGOFbgjO4bwONysfjI6DdSo1+QVCk3/F5zuZUq8ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031