UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8rccH7DyoiwUEYOS6ae+BtFEKfOMaRva/516g9hoA4U=' 
WHERE 
  key_id = 'aac84416270469ae00dadb64b87380bd42d45e73e819ccf81c74b7e831a9adec' 
  AND (
    token = '8rccH7DyoiwUEYOS6ae+BtFEKfOMaRva/516g9hoA4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032