UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6zmBlTQQyMFPVF09pwHH/X7my6Yx2gyditLVsdZ6xM4=' 
WHERE 
  key_id = '772c296bbf06e9e825a770bf44410d654383549a6ad8e3ca9a6f5129d5a5cb3a' 
  AND (
    token = '6zmBlTQQyMFPVF09pwHH/X7my6Yx2gyditLVsdZ6xM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022