UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1cyuZDa2E8THnOvS8yMVKHQWU0KcSHqVyXIRMX0wxbM=' 
WHERE 
  key_id = '3d711cb268da7de30cb69fe6bb7f522503f187aafcaa03ac3b7314ade87efea5' 
  AND (
    token = '1cyuZDa2E8THnOvS8yMVKHQWU0KcSHqVyXIRMX0wxbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026