UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N94jdonvLqp8iGMxib7B7StE1h3V71/WumWRbwoBZag=' 
WHERE 
  key_id = '68760f4e464986fe8372b7e1dead8d6d2997ddbd02e2dec366b7df12771cdacc' 
  AND (
    token = 'N94jdonvLqp8iGMxib7B7StE1h3V71/WumWRbwoBZag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019