UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Knw/rvIrVMOsEQeP5dbGNSkJKN4NgL2yDoH+cGLNWFI=' 
WHERE 
  key_id = 'a230318a0891ba97c90de651a886a974e471ddcfaf92c6293dac665918b6c03b' 
  AND (
    token = 'Knw/rvIrVMOsEQeP5dbGNSkJKN4NgL2yDoH+cGLNWFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040