UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7CJyuP4PIPzbLz+W/LSz+flcGPjx+vrOU/JzjEc1u9Q=' 
WHERE 
  key_id = '719f192f9b97d90d06a377aa929644fa515e501ae9077813d2eea02b5f5c782e' 
  AND (
    token = '7CJyuP4PIPzbLz+W/LSz+flcGPjx+vrOU/JzjEc1u9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030