UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1FA5RE7ojCNT+jzARyaQwu/2ZHiQSlmEzXhUy3n/MLc=' 
WHERE 
  key_id = 'f9989c002852977cd01de0dd456892baaa17d985c70786afde1bddf3b607e833' 
  AND (
    token = '1FA5RE7ojCNT+jzARyaQwu/2ZHiQSlmEzXhUy3n/MLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038