UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Op4Mb321JpUAMPyjhyU4XQx7aiZTK4XZokEy2VzRWcU=' 
WHERE 
  key_id = 'de49cfed46944c5588bf294501b8b09d6e2e7620a38caf04c4baa4b2a1705ef6' 
  AND (
    token = 'Op4Mb321JpUAMPyjhyU4XQx7aiZTK4XZokEy2VzRWcU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020