UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OCU5nkZxpHm9UonrPGH6FbBafBQpTxy6rjhq4d7xlY0=' 
WHERE 
  key_id = '7b0447bed9ad6983dc5707a7b28b3c681e03a83661a981d41aea570b4b155819' 
  AND (
    token = 'OCU5nkZxpHm9UonrPGH6FbBafBQpTxy6rjhq4d7xlY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071