UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JWTV030y6uuo/GFbR4n7kD7JCvYzWzgmUBsMxLyp4GI=' 
WHERE 
  key_id = 'ae64feb14a7581a1b8ca8cec4860012c5057cb703f73d225c8ff58ebcc74ef44' 
  AND (
    token = 'JWTV030y6uuo/GFbR4n7kD7JCvYzWzgmUBsMxLyp4GI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045