UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mk0fvS0YDIiZiuSJ3K9CpLDJo036mOzOjPb6dKevLqI=' 
WHERE 
  key_id = '49480122414f8b4568125c607155e6bffd2bb07a997725b67fc295e8ab420f56' 
  AND (
    token = 'Mk0fvS0YDIiZiuSJ3K9CpLDJo036mOzOjPb6dKevLqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022