UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2cW/VaQYlwDJErwSRpRTLUAjhqzIbPSB2a5llBs/jaI=' 
WHERE 
  key_id = 'dcd95e8cf0c44a6b2bde81c4e9e50e055666ba1713e871a6cddfdf152254bfc2' 
  AND (
    token = '2cW/VaQYlwDJErwSRpRTLUAjhqzIbPSB2a5llBs/jaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059