UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p3hsqBgjuCDac0CmaD5BoU2WgwuPJbN3X49UlKFi5vU=' 
WHERE 
  key_id = 'ef3e9c3b8b2ca1d61c089ddfb257566f67bc3809e03af20e5f7cedba3b83ba0a' 
  AND (
    token = 'p3hsqBgjuCDac0CmaD5BoU2WgwuPJbN3X49UlKFi5vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021