UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AzGnzbkLCA4DlwpsgPK+SoL+U4noJmXYgViRx6NYwUQ=' 
WHERE 
  key_id = '950fa26d4425b180d27ad6bc82061ca1b0093d96a8cdc36868f5b7fcc5b237bb' 
  AND (
    token = 'AzGnzbkLCA4DlwpsgPK+SoL+U4noJmXYgViRx6NYwUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035