UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QtU5ntO8+4ZpeR2K224YSkJ8LRBt1sjWg3tJzj0StA4=' 
WHERE 
  key_id = '898e86d2324d2b56ce64c8db0d3a2dcdb8adc25b6b9800432c12ef8feea7b009' 
  AND (
    token = 'QtU5ntO8+4ZpeR2K224YSkJ8LRBt1sjWg3tJzj0StA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058