UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '54/8gt09+yzFr+fD5Nv1q+GJMP6TD64oJovLDwF7yYE=' 
WHERE 
  key_id = '390fdc26c527e4a67deb7e0ce3fd738d8ed0f5c00a61ecd7eb8fc4cc3f825372' 
  AND (
    token = '54/8gt09+yzFr+fD5Nv1q+GJMP6TD64oJovLDwF7yYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050