UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q8JZxh+orJ20uZa+1n1UU/NHgJj2WbQpEHZUJXEtM7E=' 
WHERE 
  key_id = '24766719574936c101463db54e207ae456096704dfdba9207ba10edc7b56c49e' 
  AND (
    token = 'q8JZxh+orJ20uZa+1n1UU/NHgJj2WbQpEHZUJXEtM7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037