UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ksu67nyg6hrCxBUcCbUtrn/eZ/jnXORHQxQU8p0RBoo=' 
WHERE 
  key_id = '5f9bef1ea411c9fed61714f0fc835cca7451c0a9f49d605d19fe04c0f045c05f' 
  AND (
    token = 'ksu67nyg6hrCxBUcCbUtrn/eZ/jnXORHQxQU8p0RBoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020