UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'whiFz9zumpzbxEsZZIzAHpNO21WyBKzFoXDq4pGz4oo=' 
WHERE 
  key_id = '272d14e4b72c3077b99f9c422fe01de9f2ed40aeb9aa5d9335ee0e12b8d638bf' 
  AND (
    token = 'whiFz9zumpzbxEsZZIzAHpNO21WyBKzFoXDq4pGz4oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026