UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tr5HH2yL8LZ+MG4qNVVi5dcdH5d5Pkw19kvU++ixhnQ=' 
WHERE 
  key_id = '2925caed6050fc6e330991d2106243991684d6e75bc9ec5f34c64ab361effbeb' 
  AND (
    token = 'tr5HH2yL8LZ+MG4qNVVi5dcdH5d5Pkw19kvU++ixhnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030