UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aoZghw7yontezA8ZXRrV874N3jMO/zeoavbMP358tYY=' 
WHERE 
  key_id = 'afaf565b5597e3cd6324beb6ba09c0cb909da3bda5eb6473d72187a814526c40' 
  AND (
    token = 'aoZghw7yontezA8ZXRrV874N3jMO/zeoavbMP358tYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034