UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qRB9m1mzhu7dB6moxtah/srvR1F96s4+XCUz5OHAkfM=' 
WHERE 
  key_id = '98ade00e340674c9bf849c0ece937b709cbce1f414ab3afa634ec7bc18fe925c' 
  AND (
    token = 'qRB9m1mzhu7dB6moxtah/srvR1F96s4+XCUz5OHAkfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039