UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'At1POomdWGq4YZ/kV5ljUjQM3XBKulirlNOIt6EjvBc=' 
WHERE 
  key_id = '84575d5c2bc8c59fb5422f92fb08c9f1c3704d0ea2194ee663a68d476e5d3320' 
  AND (
    token = 'At1POomdWGq4YZ/kV5ljUjQM3XBKulirlNOIt6EjvBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027