UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZMC/NWNdnLANPCnDkGiHhzuZ0EdbD5+T1p6iv0P1oeQ=' 
WHERE 
  key_id = '82812d732d5ffcf508780225f586079dbae8c51569e826e4f8bba2f0a3482f65' 
  AND (
    token = 'ZMC/NWNdnLANPCnDkGiHhzuZ0EdbD5+T1p6iv0P1oeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035